
/**
 * 定义版本管理头部切换
 * @param permissions
 * @returns
 */
const getVersionManageTabSwitch = (permissions: Record<string, any>) => {
  /** 版本管理 */
  const MyVersionManageTab = () => {
    if (permissions?.['/versionController/power']) {
      return {
        // ownerID: getUserID(),
        // ownType: null,
        // queryType: 0,
        versionID: '',
      };
    }
  };

  /** 最新版本 */
  // const MyNewVersionManageTab = () => {
  //   if (permissions?.['/versionController/newVersion']) {
  //     return {
  //       signCompanyID: getLevelZero(),
  //       params: 'signCompanyID',
  //       ownType: null,
  //       queryType: 0,
  //     };
  //   }
  // };

  /** 版本审核 */
  const MyVersionCheckTab = () => {
    if (permissions?.['/versionController/checkerID']) {
      return {
        // checkID: getUserID(),
        // ownType: null,
        // queryType: 0,
        state: 1,
        versionID: '1',
      };
    }
  };

  return [
    {
      title: '版本管理',
      key: 'MyVersionManageTab',
      visible: permissions?.['/versionController/power'] ?? true,
      md: 2,
      sm: 24,
      params: MyVersionManageTab(),
    },
    // {
    //   title: '最新版本',
    //   key: 'MyNewVersionManageTab',
    //   visible: (permissions?.['/versionController/newVersion'] ?? true),
    //   md: 2,
    //   sm: 24,
    //   params: MyNewVersionManageTab(),
    // },
    {
      title: '版本审核',
      key: 'MyVersionCheckTab',
      visible: permissions?.['/versionController/checkerID'] ?? true,
      md: 2,
      sm: 24,
      params: MyVersionCheckTab(),
    },
  ];
};

export { getVersionManageTabSwitch };
